#include <string>
#include <iostream>
#include <list>
#include <deque>
#include <algorithm>
#include <stdexcept>

// boost headers

// components headers
#include "matrix.h"
#include "matrix_io.h"
#include "stlhelper.h"
#define DEBUG_LEVEL 6
#include "debug_func.h"


using std::istream;
using std::ostream;
using std::vector;
using std::list;
using std::sort;
using std::string;


namespace bcpp_matrix
{



namespace private_details
{

//________________________________________________________________________________________

//	extract_clustered_names

//________________________________________________________________________________________
vector<string>& extract_clustered_names(const vector<string>&			all_names,
										const vector<unsigned>&			indices,
										vector<string>&					new_names)
{
	debug_func_cerr(5);
    //
	// separate names into clusters
	//
	if (!indices.size())
		return new_names;
	typedef vector<unsigned>::const_iterator t_uiter;
	new_names.clear();
	new_names.reserve(indices.size());

	for (t_uiter i = indices.begin(), end = indices.end(); i != end; ++i)
	{
		assert(*i < all_names.size());
		new_names.push_back(all_names[*i]);
	}
	return new_names;
}



}	// private_details

}	// bcpp_matrix



